package com.zpark.config;

import com.zpark.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xiaoyu
 * @version 1.0 2022/10/8
 */
@Configuration
public class MyMvcConfig implements WebMvcConfigurer {
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        LoginInterceptor interceptor = new LoginInterceptor();
//        InterceptorRegistration registration = registry.addInterceptor(interceptor);
//
//        List<String> bList = new ArrayList<>();
//        bList.add("/**");
//        List<String> wList = new ArrayList<>();
//        wList.add("/login.html");
//        wList.add("/test/**");
//
//        registration.addPathPatterns(bList);
//        registration.excludePathPatterns(wList);
//
//    }
}
